/*
 * Copyright (c) 2011-2012 www.iflytek.com. All Rights Reserved.
 *  This software for customer relationship management system, developed by Iflytek-ZY-GCZX team.
 *  Software code and design for the team, copy rights reserved.
 */

var p_dashboard = function () {

    return {
        /**
         * 得到页面需要的问题有关统计数据
         */
        issue_counts:   function(){
            cdms.common.ajax_get(js_param.issue_counts_url+project_id, function (data) {
                var  counts = eval("("+data+")");
                $('#suggestion_open_counts').html(counts[4]);
                $('#suggestion_counts').html(counts[5]);
                $('#wrong_open_counts').html(counts[0]);
                $('#wrong_counts').html(counts[1]);
                $('#requirement_open_counts').html(counts[2]);
                $('#requirement_counts').html(counts[3]);
                $('#other_open_counts').html(counts[6]);
                $('#other_counts').html(counts[7]);
            });
        },
        /**
         * 载入页面时就调用
         */
        load_view:function(){
            p_dashboard.issue_counts();
        }

    }
}();

$(document).ready(function () {

    p_dashboard.load_view();
});